<html>
<head>
<title>Geolocation Permission API Test</title>
<script>

function successHandler(location) {
    var message = document.getElementById("message");
    message.innerHTML = "Latitude: " + location.coords.latitude +
    "<br>Longitude: " + location.coords.longitude;

    console.error("Success");
}

function errorHandler(error) {
    console.error(error.message);
}

<!-- One shot example -->
navigator.geolocation.getCurrentPosition(successHandler, errorHandler);

</script>
</head>
<body>
<div id="message">Location unknown</div>
</body>
</html>

